<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var str = '123'

        var str2 = '456'

        // console.log(str+str2)//123456

        var num1 = 100

        var num2 = 200

        // console.log(num1+num2)//300
        //字符串跟number类型相加，number类型会转换为string类型
        // console.log(str+num1)//123100

        var bol = true

        var bol2 = false

        //隐式转换

        // console.log(bol1+bol2)//1+0

        // console.log('' + bol1) //123true|1231|1123

        console.log(str + bol2) //123false

        console.log(num1 * num2) //20000
        console.log(num1 * bol) //100
        console.log(num1 * bol2) //0
        console.log(num1 * str) //12300
        console.log(str * str2) //56088

        console.log(num1*'123a')//NaN
    </script>
</body>

</html>